import DataProcess
import datetime
import numpy as np
import Core.Config as Config
import Core.Gadget as Gadget
import Core.WindFunctions as Wind

if __name__ == '__main__':
    #
    config = Config.Config()
    database = config.DataBase("MySQL")

    datetime1 = datetime.datetime(2010, 1, 1)
    datetime2 = datetime.datetime(2018, 7, 1)

    # 启动Wind API
    Wind.w.start()

    # dts = Gadget.GenerateMonthDates(datetime1, datetime2)
    # for dt in dts:
    #     DataProcess.Request_Write_Future_List(database=database, realtime=None, datetime1=dt)

    datetime1 = datetime.datetime(2018,10,22)
    datetime2 = datetime.datetime(2018,10,22)
    DataProcess.Download_DailyBars(database, "IF1906.CFE", "Future", datetime1, datetime2)